package com.control.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {
	
	private static final int VERSION = 1;
//	public DatabaseHelper(Context context, String name, CursorFactory factory,
//			int version) {
//		super(context, name, factory, version);
//		// TODO Auto-generated constructor stub
//	}
//	public DatabaseHelper(Context context,String name){
//		this(context,name,VERSION);
//	}
//	public DatabaseHelper(Context context,String name,int version){
//		this(context,name,null,version);
//	}
	public DatabaseHelper(Context context,String T_NAME) {
		super(context, "dddddddddddd", null, VERSION);
	}
	@Override
	public void onCreate(SQLiteDatabase db) {
		Log.i("DatabaseHelper", "create a Database");
		db.execSQL("create table history(id varchar(100) ,msgToName varchar(50), msgBody text," +
				   "msgType varchar(50),msgTime varchar(100),time varchar(50))");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.i("DatabaseHelper", "onUpgrade");
		db.execSQL("drop table is exits Induction_cooker");

	}
}
